<template>
  <base-breadcrumb>
    <a-card :bordered="false"  >
      <title-name title="审批"></title-name>
      <a-form-model ref="ruleForm" :model="form"
                    :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"
                    :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">
        <a-row :gutter="24">
          <a-col :md="24" :sm="24">
            <a-form-model-item
                    label="审批意见" prop=" " >
              <BaseInput v-model="form.designDemandType"  type="textarea" placeholder="请输入" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="当前节点名称" prop="branchId" >
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="审批人" prop="branchId" >
              <BaseInput v-model="form.designDemandType"    placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="审批时间" prop="branchId" >
              <BaseInput v-model="form.designDemandType"    placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="当前滞留时间" prop="branchId" >
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>

        <!--<a-row :gutter="24">-->
          <!--<a-col :sm="8" :md="8" >-->
            <!--<a-form-item label="签字编码"-->
                         <!--:labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"-->
                         <!--:wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">-->
              <!--<BaseInput placeholder="请输入编码" v-model="form.signCode"></BaseInput>-->
            <!--</a-form-item>-->
          <!--</a-col>-->
          <!--<a-col  :sm="2" :md="2">-->
            <!--<a-button type="primary" style="margin:0 10px">确定签字</a-button>-->
          <!--</a-col>-->
          <!--<a-col  :sm="6" :md="6">-->
            <!--<BaseInput type="textarea"></BaseInput>-->
          <!--</a-col>-->
        <!--</a-row>-->


        <!--<a-row :gutter="24">-->
          <!--<a-col :md="8" :sm="8">-->
            <!--<a-form-item-->
                    <!--label="签字编码"-->
                    <!--:labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"-->
                    <!--:wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">-->
              <!--<BaseInput  v-model="form.signNum" />-->
            <!--</a-form-item>-->
          <!--</a-col>-->
          <!--<a-col :md="16" :sm="16">-->
            <!--<a-form-item-->
                    <!--:labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"-->
                    <!--:wrapperCol="{ lg: { span: 17 }, sm: { span: 17 } }">-->
              <!--<div class="signBtn" @click="getSignImg"><a-button type="primary" >确定签字</a-button></div>-->

              <!--<div class="signImg"  >-->
                <!--&lt;!&ndash;<img :src="imgUrl" :title="" class="imgSign"/>&ndash;&gt;-->
                <!--{{imgUrl}}-->
              <!--</div>-->
            <!--</a-form-item>-->
          <!--</a-col>-->
        <!--</a-row>-->


        <a-row :gutter="24" class="overfloat">
          <a-col>
            <div class="floatRight">
              <a-button type="" style="margin-right: 20px;" @click="handelUnApproval">审批不通过</a-button>
              <a-button type="primary" @click="handelApproval">审批通过</a-button>
            </div>
          </a-col>
        </a-row>

        <title-name title="审批流程信息"></title-name>
        <a-table pagination="false" bordered row-key="id" :columns="columnApprove"   :data-source="dataSource">
          <span slot="operation" slot-scope="text, record">
          <template>
           <a @click="handleSub(record)">查看</a>
          </template>
        </span>
        </a-table>




      </a-form-model>
    </a-card>


    <a-card :bordered="false" style="over-flow:scroll">
        <title-name title="项目人员调整信息"></title-name>
      <a-form-model ref="ruleForm" :model="forms"
                    :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"
                    :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">
        <a-row>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="分公司名称">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="项目名称">
              <BaseInput v-model="form.designDemandType"    placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="调整岗位名称">
              <BaseInput v-model="form.designDemandType"    placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row   v-if="statusCode == 3">
          <a-col :md="8" :sm="8">
            <a-form-model-item label="调整类型">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="调入人员名称">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="调入人员员工编号">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>

        <a-row   v-if="statusCode ==2">
          <a-col :md="8" :sm="8">
            <a-form-model-item label="调整类型">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="被移除人员">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>

        <a-row v-if="statusCode == 1">
          <a-col :md="8" :sm="8">
            <a-form-model-item label="调整类型">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="被更换人员">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :md="8" :sm="8">
            <a-form-model-item label="调入人员名称">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row v-if="statusCode == 1">
          <a-col :md="8" :sm="8">
            <a-form-model-item label="调入人员员工编号">
              <BaseInput v-model="form.designDemandType"   placeholder="请输入" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :md="24" :sm="24">
            <a-table :columns="columnsInfo" :data-source="dataSources" bordered :pagination="false"></a-table>
          </a-col>
        </a-row>


        <a-modal width="700px" v-model="visible" :title="title" >
          <template slot="footer">
            <a-button key="back" @click="handleCancel">
              关闭
            </a-button>
          </template>
          <a-form :model="forms"  ref="form2">
            <a-row :gutter="24">
              <a-col :md="24" :sm="24">
                <a-form-item
                        label="审批意见"
                        :labelCol="{ lg: { span: 5 }, sm: { span: 5 } }"
                        :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">
                  <BaseInput type="textarea" v-model="forms.remark" disabled/>
                </a-form-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :md="12" :sm="12">
                <a-form-item
                        label="审批人"
                        :labelCol="{ lg: { span: 5 }, sm: { span: 5 } }"
                        :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">
                  <BaseInput v-model="forms.replier" disabled/>
                </a-form-item>
              </a-col>
              <a-col :md="12" :sm="12">
                <a-form-item
                        label="审批时间"
                        :labelCol="{ lg: { span:5 }, sm: { span: 5 } }"
                        :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">
                  <BaseInput v-model="forms.contactInfo" disabled />
                </a-form-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :md="12" :sm="12">
                <a-form-item
                        label="节点名称"
                        :labelCol="{ lg: { span: 5 }, sm: { span: 5 } }"
                        :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">
                  <BaseInput v-model="forms.replier" disabled />
                </a-form-item>
              </a-col>
              <a-col :md="12" :sm="12">
                <a-form-item
                        label="滞留时间"
                        :labelCol="{ lg: { span:5 }, sm: { span: 5 } }"
                        :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">
                  <BaseInput v-model="forms.contactInfo" disabled />
                </a-form-item>
              </a-col>
            </a-row>

          </a-form>
        </a-modal>

      </a-form-model>
    </a-card>
    <div class="footer page-btn-right-top">
      <a-button type="default"  @click="goBack">关闭</a-button>
    </div>
  </base-breadcrumb>
</template>

<script>
  import { STable, Ellipsis } from '@/components'
  import EditorBar from '@/components/Editor/editor' 
  import {addBasic ,getProjectType} from '@/api/design/plotsPlan'
  import { getScoreList  ,addScoreList, editScoreList} from '@/api/evaluate'
  import { addDemandList,getDetails ,editDemandList } from '@/api/design/demand'
  import  { getTypes,getUsersDetail,getOrgUsers} from '@/api/commons'

  const  columnApprove = [
    {
      title: '审批序号',
      scopedSlots: { customRender: 'serial' }
    },
    {
      title: '审批人',
      dataIndex: '',
    },
    {
      title: '审批时间',
      dataIndex: '',
    },
    {
      title: '节点名称',
      dataIndex: '',
    },
    {
      title: '滞留时间',
      dataIndex: '',
    },
    {
      title: '审批意见',
      dataIndex: '',
    },
    {
      title: '操作',
      dataIndex: 'operation',
      scopedSlots: { customRender: 'operation' }
    }
  ]
  const columnsInfo = [
    {
      title: '所在单位',
      dataIndex: '',
    },
    {
      title: '所在部门',
      dataIndex: '',
    },
    {
      title: '当前岗位',
      dataIndex: '',
    }
  ]
  export default {
  name:'a'+Date.now(),
    components:{
    },
    data(){
      return{
        title:'审批信息详情',
        columnApprove,
        columnsInfo,

        dataSource:[],
        dataSources:[],

        id:'',
        statusCode:3 ,  // 0 在岗  1更换中 2移除中 3 新增中

        visible:false,
        forms:{},

        form:{
          createTime:this.getNowTime()
        },

      }
    },
    computed: {

    },
    created() {
      this.userId = JSON.parse(sessionStorage.getItem('ycloud-user_info')).id
      this.user = JSON.parse(sessionStorage.getItem('ycloud-user_info')).username
      this.id = this.$route.query.id
      this.status = this.$route.query.status
      this.type = this.$route.query.type
    },

    methods:{
      handleCancel(){
        this.visible  = true
      },

      handelUnApproval(){  // 审批不通过
        this.$confirm({
          title: '警告提醒！',
          content: '确定审批不通过？',
          okType: 'danger',
          onOk() {

          },
          onCancel() {

          },
        });
      },

      handelApproval(){    // 审批通过  判断(支持人员必填)
        this.$confirm({
          title: '警告提醒！',
          content: '确定审批通过？',
          okType: 'danger',
          onOk() {

          },
          onCancel() {
          },
        });
      },


    }
  }
</script>

<style scoped>
  .input{
    width:100%
  }  
  .footer{
    float:right;
    margin-right:10px
  }
  .footer button{
    margin-left:10px
  }
  .signBtn{
    float: left;
  }
  .signImg{
    border: 1px solid #d9d9d9;
    width: 290px;
    height: 100px;
    float: left;
    margin-left: 40px;
  }
</style>
